Imports Microsoft.VisualBasic

Namespace MyDAO
    Public Class MyValueExpression
        Inherits MyDataExpressionBase

        Public Value As Object

        Public Overrides Function ToString() As String
            If TypeOf Value Is String Then
                Return String.Format("'{0}'", Me.Value)
            ElseIf TypeOf Value Is Date Then
                Dim s As New MyStringBuilder
                s.AppendFormat("'{0:yyyy/MM/dd HH:mm:ss}'", Me.Value)

                Return s.ToString()
            Else
                Return Me.Value.ToString()
            End If
        End Function

        Public Sub New(ByVal value As Object)
            Me.Value = value
        End Sub
    End Class
End Namespace
